﻿using System.Collections.Generic;

namespace FamilyBudgetManager.Domain
{
    public class Group
    {

        public virtual int Id { get; set; }
        public virtual string Name { get; set; }
        public virtual bool Income { get; set; }

        public virtual IList<SubGroup> SubGroups { get; protected set; }

        public Group()
        {
            SubGroups = new List<SubGroup>();
        }

        public virtual void AddSubGroup(SubGroup subGroup)
        {
            subGroup.Group = this;
            SubGroups.Add(subGroup);
        }

        public override string ToString()
        {
            return Name;
        }
    }
}
